<!DOCTYPE HTML>
<html lang="zh">
<meta charset="utf-8">
<head>
	<link href="/aityWeb/static/favicon.ico" rel="stylesheet"/>
	<link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>

	<style type="text/css">
		.nav > li:hover .dropdown-menu {display: block;}
	</style>

	<link href="/aityWeb/static/css/bootstrap.min.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/font-awesome.css" rel="stylesheet"/>
	<!-- bootstrap-table 表格插件样式 -->
	<link href="/aityWeb/static/ajax/libs/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"/>
	<link href="/aityWeb/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/animate.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/style.css" rel="stylesheet"/>
	<link href="/aityWeb/static/css/checkbox.css" rel="stylesheet"/>
	<link href="/aityWeb/static/ajax/libs/select/select2.css" rel="stylesheet"/>
	<link href="/aityWeb/static/galaxy/css/ry-ui.css" rel="stylesheet"/>


</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 select-info" style="padding-top: 10px;">
			<ul class="breadcrumb" style="font-size: 16px;background-color: #f3f3f3;padding: 5px 10px;color: #337ab7;">
				<li><i class="fa fa-home" aria-hidden="true"></i>&nbsp;&nbsp;<a href="#">首页</a></li>
				<li class="active"><a href="#">场馆管理</a></li>
			</ul>
			<div class="col-sm-12 " style="padding-top: 10px;height: 100%">
				<form id="menu-form">
					<div class="select-list">
						<ul>
							<li>
								<div class="checkbox">
									<label>
										<input type="checkbox" > 未回款场馆
									</label>
								</div>
							</li>
							<li>
								<input type="text" style="padding-left: 10px;" name="devName" placeholder="请输入关键字" />
							</li>
							<li>
								<span class="btn btn-primary btn-rounded btn-sm" onclick="search()"><i class="fa fa-search"></i>&nbsp;搜索</span>
							</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group hidden-xs" id="toolbar" role="group">
				<button type="button" class="btn btn-primary" onclick="edit();">
					<span class="glyphicon glyphicon-plus"></span>
					新增场馆
				</button>
			</div>
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
	</div>
</div>

<script src="/aityWeb/static/js/jquery.min.js"></script>
<script src="/aityWeb/static/js/bootstrap.min.js"></script>
<script src="/aityWeb/static/js/echarts.common.min.js"></script>

<!-- bootstrap-table 表格插件 -->
<script src="/aityWeb/static/ajax/libs/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/aityWeb/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js"></script>
<!-- jquery-validate 表单验证插件 -->
<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="/aityWeb/static/ajax/libs/validate/messages_zh.min.js"></script>
<script src="/aityWeb/static/ajax/libs/validate/jquery.validate.extend.js"></script>
<!-- jquery-validate 表单树插件 -->
<script src="/aityWeb/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.js"></script>
<!-- jquery-export 表格导出插件 -->
<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>
<script src="/aityWeb/static/ajax/libs/bootstrap-table/extensions/export/tableExport.js"></script>
<!-- 遮罩层 -->
<script src="/aityWeb/static/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="/aityWeb/static/ajax/libs/layer/layer.min.js"></script>
<script src="/aityWeb/static/ajax/libs/layui/layui.js"></script>
<script src="/aityWeb/static/galaxy/js/common.js?v=2.3.0"></script>
<script src="/aityWeb/static/galaxy/js/ry-ui.js?v=2.3.0"></script>

<script src="/aityWeb/static/js/app/net.js"></script>
<script src="/aityWeb/static/js/app/app.js"></script>
<script src="/aityWeb/static/js/lib/MD5.js"></script>
<script type="text/javascript">
   //调试开关
	var debug_switch = true;
    var prefix = '';
      function loadInner(url) {
        window.location.href = "add.html";
      }
   jQuery(document).ready(function() {
        dataTableInit();

   });
   
   function search(){
		 $("#bootstrap-table").bootstrapTable('refresh');
	}
   function dataTableInit() {
         $("#bootstrap-table").bootstrapTable({
//          url: "../static/json/info.json",
//          createUrl: prefix + "/add",
//          updateUrl: prefix + "/edit/{id}",
//          removeUrl: prefix + "/remove",
//          search: false,
            modalName: "设备接地箱",
            url: "http://test.dongqil.com/qyd_dongqil/shop/selectByShop",
            cache: false,
            method: 'post', 
            sortable: false, //是否启用排序
            pagination: true, //分页
            pageNumber:1,//初始化加载第一页，默认第一页
            pageSize: 10,
            pageList: [5,10, 25, 50],//可供选择的每页的行数（*）
            singleSelect: false,
//          showColumns: true,  //显示下拉框勾选要显示的列
            locale:"zh-US", //表格汉化
            search: false , //显示搜索框
            sidePagination: "server", //服务端处理分页server client
            //【查询设置】
            /* queryParamsType的默认值为 'limit' ,在默认情况下 传给服务端的参数为：offset,limit,sort
             设置为 ''  在这种情况下传给服务器的参数为：pageSize,pageNo */
            queryParamsType:'',
            queryParams: function queryParams(params) {
                     var param = {
                    data:{
                        page: params.pageNumber,
                        rows: params.pageSize,
                        type:"兑换券"
                    },
                    checkcode:"",
                    type: 1//0 APP;1 后台
            };
             syslog(JSON.stringify(param));
                return param;
                
               },
               responseHandler: function(res) {
                return {
                    "total": res.data.total,//总页数
                    "rows": res.data.rows   //数据
                 };
               },
				columns: [{
					checkbox: true
				},
                {
                    field : 'id',
                    title : '设备ID'
                },
                {
                    field : 'code',
                    title : '编号'
                },
                {
                    field : 'owner',
                    title : '负责人'
                },
                {
                    field : 'name',
                    title : '场馆名称'
                },
                {
                    field : 'address',
                    title : '地址'
                },
                    {
                        field : 'project',
                        title : '支持运动类型'
                    },
                    {
                        field : 'isreviews',
                        title : '推荐',
                                      formatter:function (value,row,index) {
                if(row.isreviews == 1){
                    return "推荐";
                }else{
                	return "不推荐";
                }
            }
                    },
                    {
                        field : 'isview',
                        title : '可见',

                        class:'colStyle',
                      formatter:function (value,row,index) {
                if(row.isreviews == 1){
                    return "可见";
                }else{
                	return "不可见";
                }
            }},
                    {
                        field : 'issign',
                        title : '签约',
                 formatter:function (value,row,index) {
                if(row.isreviews == 1){
                    return "签约";
                }else{
                	return "未签约";
                }
            }
              },
                {
                    field : 'balance',
                    title : '备用金'
                },
                {
                    field : 'huikuan',
                    title : '本周回款',
                formatter:function (value,row,index) {
                if(row.huikuan == 1){
                    return "未回款";
                }else{
                	return "已回款";
                }
            }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a href="#" onclick="info('+row.id+')"><i class="fa fa-pencil"></i>详情管理</a>') ;
                      	actions.push('<a href="#" style="margin-left: 10px;" onclick="edit('+row.id+')"><i class="fa fa-edit"></i>编辑</a> ');

                        return actions.join('');
                    }
                }]
        })
       }  
         function edit(id){
         	if(id){
         		window.location.href = "/aityWeb/view/venue/shopinfo.html?action=edit&shopid="+id;

         	}else{
         		window.location.href = "/aityWeb/view/venue/shopinfo.html?action=create&shopid="+id;


         	}
         	
    }

    function  info(id) {
       // $.loadInner.updateUrl("/aityWeb/view/venue/details/venue_detail.html");
        // $.loadInner.updateUrl("/aityWeb/view/venue/details/venue_upload.html");
        window.location.href = "/aityWeb/view/venue/details/card.html?shop="+id;
         syslog(JSON.stringify(id));
//      $.loadInner.updateUrl("/aityWeb/view/venue/details/card.html?shop="+id);
    }
    	function syslog(strlog){
		if(debug_switch){
			console.log(strlog);
		}
	}


//  $(function() {
//
//      var options = {
//          url: "/aityWeb/static/json/venue/venue_list.json",
//          createUrl: prefix + "/add",
//          updateUrl: prefix + "/edit/{id}",
//          removeUrl: prefix + "/remove",
//          search: false,
//          modalName: "俱乐部管理",
//          columns: [{
//              checkbox: true
//          },
//              {
//                  field : 'id',
//                  title : 'ID'
//              },
//              {
//                  field : 'devName',
//                  title : '编号'
//              },
//              {
//                  field : 'devType',
//                  title : '负责人'
//              },
//              {
//                  field : 'voltageLevel',
//                  title : '场馆名称'
//              },
//              {
//                  field : 'address',
//                  title : '支持运动类型'
//              },
//              {
//                  field : 'voltage',
//                  title : '推荐'
//              },
//              {
//                  field : 'current',
//                  title : '可见'
//              },
//              {
//                  field : 'cableTemperature',
//                  title : '签约'
//              },
//              {
//                  field : 'temperatureInner',
//                  title : '备用金余额'
//              },
//              {
//                  field : 'location',
//                  title : '本周回款'
//              },
//              {
//                  title: '操作',
//                  align: 'center',
//                  formatter: function(value, row, index) {
//                      var actions = [];
//                      actions.push('<a href="#" onclick="info()"><i class="fa fa-info"></i>详情管理</a>') ;
//                      actions.push('<a href="#" onclick="edit()"><i class="fa fa-edit"></i>编辑</a> ');
//                      return actions.join('');
//                  }
//              }]
//      };
//      $.table.init(options);
//  });
//
//  function edit(){
//      $.loadInner.updateUrl("/aityWeb/view/clubManger/edit.html");
//  }
//
//  function  info() {
//     // $.loadInner.updateUrl("/aityWeb/view/venue/details/venue_detail.html");
//      // $.loadInner.updateUrl("/aityWeb/view/venue/details/venue_upload.html");
//      $.loadInner.updateUrl("/aityWeb/view/venue/details/card.html");
//  }

</script>
</body>
</html>

